//
//  BQPayMentCell.m
//  BeeQuick
//
//  Created by mac on 16/11/22.
//  Copyright © 2016年 six_group. All rights reserved.
//

#import "BQPayMentCell.h"

@implementation BQPayMentCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.liJianLabel.layer.borderWidth = 0.5;
    self.liJianLabel.layer.borderColor = [[UIColor redColor]CGColor];
    
    [self layoutIfNeeded];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    
}
- (IBAction)choosePayment:(UIButton *)sender {
    
    if (_paymentButton == nil){
        sender.selected = YES;
        _paymentButton = sender;
    }
    else if (_paymentButton !=nil && _paymentButton == sender){
        sender.selected = YES;
        
    }
    else if (_paymentButton!= sender && _paymentButton!=nil){
        _paymentButton.selected = NO;
        sender.selected = YES;
        _paymentButton = sender;
    }
}

- (void)setModel:(BQHomeGoodModel *)model
{
    _model = model;
    
    
    self.nameLabel.text = model.name;
    
    self.priceLabel.text = model.price;
    
    self.numLabel.text = @(_model.buyCount).description;
    
}

@end
